@extends('web.index')
@section('con')
    <ol class="breadcrumb">
        <li class="active">测试</li>
        <li class="active">搜索结果</li>
    </ol>
    <form class="input-group" method="get" action="{{url('/search')}}">
        <span class="input-group-addon"><i class="fa fa-search"></i></span>
        <input type="text" name="keywords" class="form-control" placeholder="搜索题库..." value="{{$keywords}}">
        <span class="input-group-btn">
            <button id="search" class="btn btn-default">Go!</button>
        </span>
    </form>
    <script>
        $('#search').click(function () {
            $(this).html('<i class="fa fa-spinner fa-pulse"></i>').css('width', '48.58px');
        });
    </script>
    <ul class="nav nav-pills">
        @if(!$polity_choices->isEmpty())
            <li><a href="#polity_choices">政治 - 选择题</a></li>
        @endif
        @if(!$polity_analysis->isEmpty())
            <li><a href="#polity_analysis">政治 - 辨析题</a></li>
        @endif
    </ul>
    @if(!$polity_choices->isEmpty())
        <div class="alert alert-info" id="polity_choices">政治 - 选择题</div>
    @endif
    @foreach($polity_choices as $v)
        <div class="alert alert-success alert-dismissible animated flipInX" style="text-align: left;">
            <h4><i class="fa fa-question-circle"></i> {{ $v->title }}</h4>
            <p style=" text-indent:2em"><b>A.</b> {{ $v->option_a }}</p>
            <p style=" text-indent:2em"><b>B.</b> {{ $v->option_b }}</p>
            <p style=" text-indent:2em"><b>C.</b> {{ $v->option_c }}</p>
            <p style=" text-indent:2em"><b>D.</b> {{ $v->option_d }}</p>
            <p>正确答案：<b>{{ $v->answer }}</b>
            </p>
        </div>
    @endforeach
    @if(!$polity_analysis->isEmpty())
        <div class="alert alert-info" id="polity_analysis">政治 - 辨析题</div>
    @endif
    @foreach($polity_analysis as $v)
        <div class="alert alert-success alert-dismissible animated flipInX" style="text-align: left;">
            <h4><i class="fa fa-question-circle"></i> {{ $v->title }}</h4>
            <div>{!! $v->answer !!}</div>
        </div>
    @endforeach
@endsection